package com.lqg.bookLibrary.controller;

import com.lqg.bookLibrary.common.core.domain.JsonResult;
import com.lqg.bookLibrary.common.myInterface.CurrentUser;
import com.lqg.bookLibrary.common.myInterface.CurrentUserPojo;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/token")
@CrossOrigin
public class TokenController {

    @GetMapping("/test")
    public JsonResult test1(@CurrentUser CurrentUserPojo userPojo,
                                       Authentication authentication) {
        System.out.println(userPojo.getUserId());
        System.out.println(authentication.getName());
        return JsonResult.success("s");
    }

    @GetMapping("/test2")
    public JsonResult test2() {
        return JsonResult.success("s");
    }

}
